package com.hgd.security.evp.auth.properties;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 尚
 */
@Component
@ConfigurationProperties(prefix = "security.permit")
@Slf4j
public class PropertiesConfig {

    private List<String> antMatchers;

    @PostConstruct
    public void init(){
        if(antMatchers == null){
            antMatchers=new ArrayList<>();
        }
        log.debug("初始化Security放权的路径:"+antMatchers.toString());
        antMatchers.add("/authentication/require");
        antMatchers.add("/authentication/logout");
        antMatchers.add("/login");
    }

    public List<String> getAntMatchers() {
        return antMatchers;
    }

    public void setAntMatchers(List<String> antMatchers) {
        this.antMatchers = antMatchers;
    }
}
